//
// @Auther: by wujehy 
// @Email:wujehy@qq.com
// @Data:20-4-17
// @Time:下午4:49
//

#ifndef TESTSERVER_INTERNALTYPES_H
#define TESTSERVER_INTERNALTYPES_H

// 颜色
#define RESET   "\033[0m"
#define BLACK   "\033[30m"      /* Black */
#define RED     "\033[31m"      /* Red */
#define GREEN   "\033[32m"      /* Green */
#define YELLOW  "\033[33m"      /* Yellow */
#define BLUE    "\033[34m"      /* Blue */
#define MAGENTA "\033[35m"      /* Magenta */
#define CYAN    "\033[36m"      /* Cyan */
#define WHITE   "\033[37m"      /* White */
#define BOLDBLACK   "\033[1m\033[30m"      /* Bold Black */
#define BOLDRED     "\033[1m\033[31m"      /* Bold Red */
#define BOLDGREEN   "\033[1m\033[32m"      /* Bold Green */
#define BOLDYELLOW  "\033[1m\033[33m"      /* Bold Yellow */
#define BOLDBLUE    "\033[1m\033[34m"      /* Bold Blue */
#define BOLDMAGENTA "\033[1m\033[35m"      /* Bold Magenta */
#define BOLDCYAN    "\033[1m\033[36m"      /* Bold Cyan */
#define BOLDWHITE   "\033[1m\033[37m"      /* Bold White */

enum ErrorCode
{
    ERROR_SUCCESS = 0,
    ERROR_FAIL = -1,
};

struct SensorDataType
{
    int64_t uid; // 用户
    uint64_t GatewayId; // 网关id
    uint64_t DeviceId; // 终端id
    int32_t permission;
    int32_t key; // key
    std::string data; // 具体数据,透传
    int64_t modifyat;
    int64_t create;
};

struct DeviceDataType
{
    int64_t uid; // 用户
    uint64_t GatewayId; // 网关id
    uint64_t DevideId; // 终端id
    int32_t permission;
    std::string Note;
    std::string Token;
    int64_t modifyat;
    int64_t create;
};

enum NETWORK_MOD_TYPE
{
    NETWORK_MOD_TYPE_AUTH = 1,
    NETWORK_MOD_TYPE_IOT = 2,
};

enum AUTH_MOD_TYPE
{
    AUTH_REGISTER = 1,
    AUTH_LOGIN = 2,
    AUTH_LOGOUT = 3,
    AUTH_CHANGE_PASSWORD = 5,
};

enum IOT_MOD_TYPE
{
    IOT_UPLOAD_SENSOR_DATA = 1,
    IOT_FIND_SENSOR_DATA = 2,
    IOT_CONTROL_DEVICE = 3,
    IOT_CONTROL_ACK = 4,
    IOT_CONTROL_ACK_LISTERNER = 5,
    IOT_CONTROL_LISTERNER = 6,
    IOT_LOGIN_DEVICE = 7,
    IOT_HEART_BEAT = 8,
    IOT_FIND_GATEWAY = 9,
    IOT_CREATE_DEVICE = 10,
    IOT_FIND_DEVICE_TOKEN = 11,
    IOT_GENERATE_DEVICE_TOKEN = 12,
    IOT_FIND_MY_DEVICE = 13,
};
#endif //TESTSERVER_INTERNALTYPES_H
